  
<div class="form-group">
    <label class="col-sm-2 control-label must">任务名称</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'task.edit'}
        <div class="input-group">
            <input type="text" name="title" class="form-control" value="{$item['title']}" data-rule-required="true" />
            <input type="hidden" id="titleimg" name="titleicon" value="{if !empty($item['titleicon'])}{$item['titleicon']}{else}http://sky.foxdev.cn/addons/ewei_shopv2/plugin/task/static/images/taskicon.png{/if}">
            <span class="input-group-addon" style="padding: 0px;"><img src="{if !empty($item['titleicon'])}{$item['titleicon']}{else}http://sky.foxdev.cn/addons/ewei_shopv2/plugin/task/static/images/taskicon.png{/if}" id="showimg" width="34px" height="34px"></span>
            <span class="input-group-addon btn" data-toggle="selectImg" data-input="#titleimg" data-img="#showimg" data-full="1">选择图标</span>
        </div>
        {else}
        <div class='form-control-static'><img src="{if !empty($item['titleicon'])}{$item['titleicon']}{else}http://sky.foxdev.cn/addons/ewei_shopv2/plugin/task/static/images/taskicon.png{/if}"  width="34px" height="34px">{if !empty($item['title'])}{$item['title']}{else}暂无标题{/if}</div>
        {/if}
    </div>
</div>


<div class="form-group">
    <label class="col-sm-2 control-label must">关键词</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'task.edit'}
        <input type="text" name="keyword" class="form-control" value="{$item['keyword']}" data-rule-required="true"  />
        <span class='help-block'>生成海报的关键词</span>
        {else}
        <div class='form-control-static'>{$item['keyword']}</div>
        {/if}
    </div>
</div>


<div class="form-group">
    <label class="col-sm-2 control-label must">任务有效期</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'task.edit'}
        {php echo tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $starttime),'endtime'=>date('Y-m-d H:i', $endtime)),true);}
        <span class='help-block'>可领取任务的时间段</span>
        {else}
        <div class='form-control-static'>{php echo date('Y-m-d H:i', $starttime).'-'.date('Y-m-d H:i', $endtime);}</div>
        {/if}
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label must">任务完成期限</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'task.edit'}
        <input type="number" name="days" class="form-control" value="{php echo $item['days']/24/3600;}" data-rule-required="true"  />
        <span class='help-block'>任务领取后在此时间内完成，最长时间30天（临时二维码规定）</span>
        {else}
        <div class='form-control-static'>{php echo $item['days']/24/3600;}天</div>
        {/if}
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label must">任务奖励有效期限</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'task.edit'}
        <input type="number" name="reward_days" class="form-control" value="{php echo $item['reward_days']/24/3600;}" data-rule-required="true"  />
        <span class='help-block'>任务完成后在此时间内领取奖励，无限期请设置0（单位：天）</span>
        {else}
        <div class='form-control-static'>{php echo $item['reward_days']/24/3600;}天</div>
        {/if}
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label">任务未开始提示</label>

    <div class="col-sm-9 col-xs-12">
        {ifp 'task.edit'}
        <textarea name="starttext" class="form-control"  >{if $item['starttext']}{$item['starttext']}{else}活动于 [任务开始时间] 开始，请耐心等待...{/if}</textarea>
        <span class="help-block">默认：活动于 [任务开始时间] 开始，请耐心等待...</span>
        <span class="help-block">变量：[任务开始时间] 活动开始时间 [任务结束时间] 活动结束时间</span>
        {else}
        <div class='form-control-static'>{$item['starttext']}</div>
        {/if}
    </div>

</div>

<div class="form-group">
    <label class="col-sm-2 control-label">任务结束提示</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'task.edit'}
        <textarea name="endtext" class="form-control"  >{if $item['endtext']}{$item['endtext']}{else}活动已结束，谢谢您的关注!{/if}</textarea>
        <span class="help-block">默认：活动已结束，谢谢您的关注!</span>
        <span class="help-block">变量：[任务开始时间] 活动开始时间 [任务结束时间] 活动结束时间</span>
        {else}
        <div class='form-control-static'>{$item['endtext']}</div>
        {/if}
    </div>
</div>


<div class="form-group">
    <label class="col-sm-2 control-label">生成等待文字</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'task.edit'}
        <textarea name="waittext" class="form-control"  >{if $item['waittext']}{$item['waittext']}{else}您的专属海报正在拼命生成中，请等待片刻...{/if}</textarea>
        <span class="help-block">例如：您的专属海报正在拼命生成中，请等待片刻...</span>
        <span class="help-block">变量：[任务开始时间] 活动开始时间 [任务结束时间] 活动结束时间</span>
        {else}
        <div class='form-control-static'>{$item['waittext']}</div>
        {/if}
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">是否可重复</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'task.edit'}
        <label class="radio-inline">
            <input type="radio" name="is_repeat" value="0" {if $item['is_repeat']==0}checked{/if} /> 禁用
        </label>

        <label class="radio-inline">
            <input type="radio" name="is_repeat" value="1" {if $item['is_repeat']==1}checked{/if} /> 启用
        </label>
        <span class="help-block">任务完成、任务失败后是否可重复领取任务</span>
        {else}
        <div class='form-control-static'>{if $item['is_repeat']==0}禁用{else}启用{/if}</div>
        {/if}
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">是否启用</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'task.edit'}
        <label class="radio-inline">
            <input type="radio" name="status" value="0" {if $item['status']==0}checked{/if} /> 禁用
        </label>

        <label class="radio-inline">
            <input type="radio" name="status" value="1" {if $item['status']==1}checked{/if} /> 启用
        </label>
        {else}
        <div class='form-control-static'>{if $item['status']==0}禁用{else}启用{/if}</div>
        {/if}
    </div>
</div>